/* eslint-disable @typescript-eslint/no-var-requires */
const eMock = require('webpack-mock-middleware')
const isMock = process.env.npm_config_mock
module.exports = app => {
  if (isMock) {
    app.all('/api/*', function(req, res, next) {
      console.log('---', req.path)
      eMock(req, res, next)
    })
  }
}
